def count_words(filepath):
    with open(filepath, 'r') as file:
        string = file.read()
        string_list = string.split(" ")
        return len(string_list)

# debug
print(count_words("p049.txt"))
